package com.anjubao.parking.municipal.roadside.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * led灯状态
 * @author zhuchunfeng
 * @date 2019/6/14 10:26
 */
@Getter
@AllArgsConstructor
public enum LedEnum {
    LED_00("00", "三色指示灯全灭",""),
    LED_01("01", "红色指示灯","车位占用"),
    LED_02("02", "绿色指示灯","车位空闲"),
    LED_04("04", "蓝（黄）色指示灯","异常报警"),
    LED_07("07", "三色指示灯全",""),
    LED_11("11", "红色指示灯闪","车辆预驶离"),
    LED_12("12", "绿色指示灯闪","车辆预驶入"),
    LED_14("14", "蓝（黄）色指示灯闪",""),
    LED_17("17", "三色指示灯全","");


    private String code;

    private String desc;

    private String note;

    public static String getDescByCode(String code) {
        for (LedEnum e : LedEnum.values()) {
            if (e.getCode().equals(code)) {
                return e.getDesc();
            }
        }
        return null;
    }

    public static Boolean exist(String code) {
        for (LedEnum e : LedEnum.values()) {
            if (e.getCode().equals(code)) {
                return true;
            }
        }
        return false;
    }
}
